<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <link rel="stylesheet" href="${staticServer}/inc/style/main.css"/>
    <link rel="stylesheet" href="${staticServer}/inc/style/page.css"/>
    <link rel="stylesheet" href="${staticServer}/css/struct_info.css"/>
    <script src="${staticServer}/inc/js/jquery.js"></script>
    <script src="${staticServer}/inc/js/pageset.js"></script>
    <script src="${staticServer}/inc/js/submitter.js"></script>
    <script src="${staticServer}/inc/js/infopad.js?2.2"></script>
    <script type="text/javascript" src="${staticServer}/common/uploadify/jquery.uploadify.js"></script>
    <script type="text/javascript" src="${staticServer}/js/web/uploadImg.js?1.5"></script>
    <link rel="stylesheet" href="${staticServer}/inc/style/date/datepicker.css"/>
    <script src="${staticServer}/inc/js/datepicker.js"></script>

    <style>
        #SWFUpload_0 {
            margin-top: 70px;
            margin-left: -30px;
        }
    </style>
    <script type="text/javascript">
    var contextPath = '${contextPath}';
    var _contextPath = '${staticServer}';

    $(function () {
        
        $("#type").val("<#if type??>${type}</#if>");
		$("#good_mnus").val("<#if goodsService??>${goodsService.serviceType}</#if>");
		$("#pratin").html("<option><#if goodsService??>${goodsService.serviceDetailName}</#if></option>");
		$("#apply_status").val("<#if goodsService??>${goodsService.goods_state}<#else></#if>");
		
		$("#apply_status2").change(function(){
			var apply_status2 = $("#apply_status2").val();
			if(apply_status2=="3"){
				$("#servicename").show();
			}else{
				$("#servicename").hide();
			}
		})
    });
    var updateGoodsService=function(){
    	var id = $("#id").val();
    	var goods_State = $("#apply_status").val();
   		var goods_State2=$("#apply_status2").val();
   		var servicename=$("#servicename").val();
        $.post("${contextPath}/goods/updateGoodsServiceState.json", {
            "id":id,
            "goods_State":goods_State,
            "goods_State2":goods_State2,
            "servicename":servicename
        }, function (ms) {
            var msg=ms.msg;
        	if(msg=="1"){
        		infopad.msg("操作成功!");
        		window.location.href = "${contextPath}/goods/goodsServiceList.htm";
        	}else{
        		infopad.err("操作失败,请联系管理员!");
        	}
        }); 
    }

    </script>
</head>
<input type="hidden" id="id" value="<#if goodsService??>${goodsService.id}</#if>">
<body>
<div id="home_link">
    <ul>
        <li></li>
        <li>&gt;</li>
        <li>采购管理</li>
        <li>&gt;</li>
        <li class="current">物品维修</li>
    </ul>
</div>
<div id="container">
    <div id="title">物品维修</div>
    <table id="infotable">
        <tr>
            <th>所属中心:</th>
            <td>
                <select id="center_id" disabled="disabled">
                <#if tgOfficeList??>
                    <#list tgOfficeList as list>
                        <option value="${list.keyname}">${list.name}</option>
                    </#list>
                </#if>
                </select>
            </td>
        </tr>
        <tr>
            <th>维修类型:</th>
            <td>
                <select id="goodsServiceType" disabled="disabled">
                    <option value="1">工程维修</option>
                    <option value="2">网络维修</option>
                    <option value="3">其他</option>
                </select>
            </td>
        </tr>

        <tr>
            <th>物品分类:</th>
            <td >
                <select id="good_mnus" disabled="disabled">
                    <option value="1">建筑</option>
                    <option value="2">家具及其他硬件</option>
                    <option value="3">电器</option>
                    <option value="4">卫生间</option>
                    <option value="5">数码产品</option>
                    <option value="6">其他</option>
                </select>
                <select id="pratin" disabled="disabled">
                    <option value="">请选择</option>
                </select>
            </td>
        </tr>
        
        <tr>
				<th>物品相关图片:</th>
				<td>
					<ul class="imglist">
					<div id="images" style="float: left;">
						<#if goodsService.image_url?? && goodsService.image_url!="">
							<#list goodsService.image_url?split(",") as imgurl>
								<#if imgurl_index !=0>
								<img rel="800:485" width="180" height="109.125" src="http://120.55.241.58/${imgurl}">
								</#if>
							</#list>
						</#if>
					</div>
						
					</ul>
				</td>
			</tr>
        <tr>
            <th>维修说明:</th>
            <td>
                <textarea id="msg" style="width:400px;height: 150px;" disabled="disabled"> <#if goodsService??>${goodsService.msg}</#if></textarea>
            </td>
        </tr>
		<tr>
            <th>审核状态:</th>
            <td>
	            <#if webutil.getCookieUser().departments=="行政教务部"&&flag!="see">
	                 <select id="apply_status">
	                        <option value="">请选择</option>
	                        <option value="1">未审核</option>
	                        <option value="2">审核通过</option>
	                </select>
                <#elseif webutil.getCookieUser().departments!="行政教务部"&&flag!="see">
	                 <select id="apply_status2">
	                        <option value="">请选择</option>
	                        <option value="3">处理中</option>
	                        <option value="4">已完成</option>
	                </select>
	                 <select id="servicename" style="display:none">
	                 	<#if userinfos??>
	                 		<#list userinfos as list>
	                        	<option value="${list.nickname }">${list.nickname }</option>
	                        </#list>
	                    </#if>
	                </select>
                <#else>
	                 <select id="apply_status3" disabled="disabled">
	                 	<#if goodsService.goods_state??&&goodsService.goods_state=="1">
	                        <option value="">未审核</option>
	                 	<#elseif goodsService.goods_state??&&goodsService.goods_state=="2">
	                        <option value="">审核通过</option>
	                 	<#elseif goodsService.goods_state??&&goodsService.goods_state=="3">
	                        <option value="">处理中</option>
	                 	<#elseif goodsService.goods_state??&&goodsService.goods_state=="4">
	                        <option value="">已完成</option>
	                    </#if>
	                </select>
                </#if>
            </td>
        </tr>
    </table>
    <div id="controlbar">
    	<#if flag!="see">
        	<input type="button" class="submit" onclick="updateGoodsService()" value="  保  存  "/>
        </#if>
        <input type="button" class="btn_normal" onclick="javascript:history.back(-1);" value="  返回列表 "/>
    </div>
</div>

</body>
</html>